package tp.ui.menu.client;

import java.util.List;

import tp.model.Ticket;
import tp.ui.menu.pattern.SousMenu;
import tp.util.DataSingleton;

public class MyActiveReservations extends SousMenu {

	public MyActiveReservations() {
		super("Lister tous mes tickets actifs");
	}

	@Override
	public void execute() {

		List<Ticket> tickets = DataSingleton
				.getInstance()
				.getFacade()
				.clientGetAllActiveTickets(
						DataSingleton.getInstance().getClient());
		if(tickets != null)
		{
			System.out.println("Listde de mes tickets : (" + tickets.size() + ")");
			
			for (Ticket ticket : tickets) {
				System.out.println(ticket);
			}
			
		}
		else
		{
			System.out.println("Il n'y a aucun ticket a afficher");
		}
	}
}
